<!doctype html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">
    <title>Demo - DPL Tabs</title>
    <link href="../../../css/assets/dpl/base.css" rel="stylesheet"/>
    <link href="../../../css/demo/dpl/assets/docs.css" rel="stylesheet"/>
    <link href="../../../button/assets/dpl.css" rel="stylesheet"/>
    <link href="../../../toolbar/assets/dpl.css" rel="stylesheet"/>
    <link href="../../assets/dpl.css" rel="stylesheet"/>
</head>
<body>

<div class="container">

    <h1>完全程序产生 Tabs - click</h1>

    <div id="tabs">


    </div>


    <h1>完全程序产生 Tabs - mouse</h1>

    <div id="tabs2">


    </div>


</div>
<script src="/kissy/build/seed-debug.js"></script>
<script src="/kissy/src/package.js"></script>
<script>
    KISSY.use("tabs", function (S, Tabs) {
        var tabs = new Tabs({
            render: "#tabs",
            listeners: {
                afterSelectedTabChange: function (e) {
                    S.log('1 changed to: ' + e.newVal.get('content'))
                },
                beforeTabClose: function (e) {
                    if (!confirm('confirmed to delete ' + e.target.get('content'))) {
                        e.preventDefault();
                    }
                }
            },
            items: [
                {
                    title: 'tab-1',
                    selected: true,
                    content: '<p>panel-1</p>',
                    closable: true
                },
                {
                    title: 'tab-2',
                    content: '<p>panel-2</p>'
                }
            ]
        }).render();


        var tabs2 = new Tabs({
            render: "#tabs2",
            changeType: 'mouse',
            listeners: {
                afterSelectedTabChange: function (e) {
                    S.log('2 changed to: ' + e.newVal.get('content'))
                }
            },
            items: [
                {
                    title: 'tab-1',
                    selected: true,
                    content: '<p>panel-1</p>',
                    closable: true
                },
                {
                    title: 'tab-2',
                    content: '<p>panel-2</p>'
                }
            ]
        }).render();

    });
</script>
</body>
</html>